package com.edu.cs576.playerWithHyperLink;

import javax.swing.*;


import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Rectangle;
import java.io.FileNotFoundException;

public class PlayerPanel2 {
	

	public JPanel CreatLayOut(JPanel VideoPanel)
	{
		JPanel totalGUI = new JPanel();
		totalGUI.setLayout(null);
		//JPanel VideoPanel = new JPanel();
		//VideoPanel.setLayout(null);
		//VideoPanel.setLocation(0,0);
		//VideoPanel.setSize(700, 500);
		//VideoPanel.add(VideoLabel);
		totalGUI.add(VideoPanel);
		totalGUI.setOpaque(true);
		
		Insets insets = totalGUI.getInsets();
	    Dimension VideoPanelsize = VideoPanel.getPreferredSize();
	    VideoPanel.setBounds(25 + insets.left, 25 + insets.top,VideoPanelsize.width, VideoPanelsize.height);
	    
	    JPanel ButtonPanel = new JPanel();
	    JButton playButton = new JButton("Play");
	    JButton	pauseButton = new JButton("Pause");
	    JButton forwardButton = new JButton("Forward");
	    JButton backwardButton = new JButton("Backward");
	    JButton stopButton = new JButton("Stop");
	    
	    ButtonPanel.add(forwardButton);
	    ButtonPanel.add(backwardButton);
	    ButtonPanel.add(playButton);
	    ButtonPanel.add(pauseButton);
	    ButtonPanel.add(stopButton);
	    
	    //Rectangle rec = new Rectangle(10,10,10,10);
	    //VideoPanel.add(rec);
	    
	    
	    totalGUI.add(ButtonPanel);	    
	    Dimension ButtonPanelsize = ButtonPanel.getPreferredSize();
	    ButtonPanel.setBounds(25 + insets.left, 330 + insets.top, ButtonPanelsize.width, ButtonPanelsize.height);
	    

	    
        pauseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	PrimaryVideo temp = new PrimaryVideo();
                temp.setIsPause();
                System.out.println("getIsPause(): " + temp.getisPause());
            }
        });
        
        playButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	PrimaryVideo temp = new PrimaryVideo();
                temp.setNotPause();
                System.out.println("getIsPause(): " + temp.getisPause());
                if(temp.getIsStop() == true)
                {
                	
                	temp.setisPlayAfterStop();
                	temp.setNotStop();
                }
            }
        });
        
        stopButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	PrimaryVideo temp =  new PrimaryVideo();
				temp.setIsStop();
            }
        });
	    
	    
	    
	    
	    
	    
	    
	    
	    
		
		
		return totalGUI;		
	}
	
	
}
